﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using CodeStash.Common.Enums;

namespace CodeStash.Common.DTOS
{
    [DataContract]
    public class JSONSearchInput
    {
        public JSONSearchInput(
            string codeStashToken, 
            string email, 
            string password, 
            SearchType searchType,
            string searchValue, 
            int pageNo, 
            int pageSize,
            CodeSnippetVisibility visibility, 
            string[] tags,
            bool includeRatings=false,
            int rating=0)
        {
            this.CodeStashToken = codeStashToken;
            this.Email = email;
            this.Password = password;
            this.SearchType= searchType;
            this.SearchValue = searchValue; 
            this.PageNo= pageNo;
            this.PageSize= pageSize;
            this.Visibility= visibility; 
            this.Tags = tags;
            this.IncludeRatings = includeRatings;
            this.Rating = rating;
        }


        [DataMember]
        public int CodeSnippetId { get; private set; }

        [DataMember]
        public string CodeStashToken { get; private set; }

        [DataMember]
        public string Email { get; private set; }

        [DataMember]
        public string Password { get; private set; }

        [DataMember]
        public SearchType SearchType { get; private set; }

        [DataMember]
        public string SearchValue { get; private set; }

        [DataMember]
        public int PageNo { get; private set; }

        [DataMember]
        public int PageSize { get; private set; }

        [DataMember]
        public CodeSnippetVisibility Visibility { get; private set; }

        [DataMember]
        public string[] Tags { get; private set; }

        [DataMember]
        public bool IncludeRatings { get; private set; }

        [DataMember]
        public int Rating { get; private set; }
    }
}
